﻿using Modules.Project;
using PmSoft;
using System.ComponentModel.DataAnnotations;
using System.Xml.Linq;
using static Modules.Project.ProjectConstants;

namespace ManagementApi.Models.Project
{
    /// <summary>
    /// 项目基础信息登记表单模型
    /// </summary>
    public class ProjectCheckInForm
    {
        /// <summary>
        /// 项目ID
        ///</summary>
        [Display(Name = "项目ID")]
        public int? ProjectId { get; set; }

        /// <summary>
        /// 行业主管部门
        ///</summary>
        [Display(Name = "行业分类")]
        [Required(ErrorMessage = "{0}不能为空")]
        public 行业主管部门 IndustryType { get; set; }

        /// <summary>
        /// 行业主管部门项目编号/住建：西藏自治区建筑市场监管平台项目编号
        ///</summary>
        [Display(Name = "行业主管部门项目编号/住建：西藏自治区建筑市场监管平台项目编号")]
        public string? IndustryPrjNum { get; set; }

        /// <summary>
        /// 项目名称
        ///</summary>
        [Display(Name = "项目名称")]
        [Required(ErrorMessage = "{0}不能为空")]
        public string Name { get; set; }

        /// <summary>
        /// 项目编号
        ///</summary>
        [Display(Name = "项目编号")]
        public string? prjNum { get; set; }

        /// <summary>
        /// 是否有施工许可证
        ///</summary>
        [Display(Name = "是否有施工许可证")]
        [Required(ErrorMessage = "{0}不能为空")]
        public bool IsBuilderLicence { get; set; }

        /// <summary>
        /// 施工许可证编号
        ///</summary>
        [Display(Name = "施工许可证编号")]
        public string? BuilderLicences { get; set; }

        /// <summary>
        /// 施工许可证发证日期
        ///</summary>
        [Display(Name = "施工许可证发证日期")]
        public DateTime? BuilderLicencesGrantDate { get; set; }

        /// <summary>
        /// 施工许可证有效期限
        ///</summary>
        [Display(Name = "施工许可证有效期限")]
        public DateTime? BuilderLicencesTermDate { get; set; }

        /// <summary>
        /// 项目简介
        ///</summary>
        [Display(Name = "项目简介")]
        public string? Description { get; set; }

        /// <summary>
        /// 项目分类。参建项目分类字典表
        ///</summary>
        [Display(Name = "项目分类")]
        [Required(ErrorMessage = "{0}不能为空")]
        public 项目分类 Category { get; set; }

        /// <summary>
        /// 建设单位Id
        ///</summary>
        [Display(Name = "建设单位Id")]
        public int? BuildCorpId { get; set; }

        /// <summary>
        /// 建设单位名称
        ///</summary>
        [Display(Name = "建设单位名称")]
        public string? BuildCorpName { get; set; }

        /// <summary>
        /// 建设单位统一社会信用代码，如果无统一社会信用代码，则填写组织机构代码
        ///</summary>
        [Display(Name = "建设单位统一社会信用代码")]
        public string? BuildCorpCode { get; set; }

        /// <summary>
        /// 建设用地规划许可证编号。AES
        ///</summary>
        [Display(Name = "建设用地规划许可证编号")]
        public string? BuildPlanNum { get; set; }

        /// <summary>
        /// 建设单位联系电话
        ///</summary>
        [Display(Name = "建设单位联系电话")]
        public string? BuildPhoneNum { get; set; }

        /// <summary>
        /// 建设工程规划许可证编号。AES
        ///</summary>
        [Display(Name = "建设工程规划许可证编号")]
        public string? PrjPlanNum { get; set; }

        /// <summary>
        /// 项目所在城市。参考行政区划字典表
        ///</summary>
        [Display(Name = "项目所在城市")]
        [Required(ErrorMessage = "{0}不能为空")]
        public int CityCode { get; set; }

        /// <summary>
        /// 项目所在区县。参考行政区划字典表
        ///</summary>
        [Display(Name = "项目所在区县")]
        [Required(ErrorMessage = "{0}不能为空")]
        public int AreaCode { get; set; }

        /// <summary>
        /// 总投资，单位：（万元）
        ///</summary>
        [Display(Name = "总投资")]
        public decimal? Invest { get; set; }

        /// <summary>
        /// 总面积，单位：平方米
        ///</summary>
        [Display(Name = "总面积")]
        public decimal? BuildingArea { get; set; }

        /// <summary>
        /// 总长度，单位：米
        ///</summary>
        [Display(Name = "总长度")]
        public decimal? BuildingLength { get; set; }

        /// <summary>
        /// 实际开工日期
        ///</summary>
        [Display(Name = "实际开工日期")]
        public DateTime? StartDate { get; set; }

        /// <summary>
        /// 竣工日期，精确到 天，格式：yyyy-MM-dd
        ///</summary>
        [Display(Name = "竣工日期")]
        public DateTime? EndDate { get; set; }

        /// <summary>
        /// 联系人姓名
        ///</summary>
        [Display(Name = "联系人姓名")]
        public string? LinkMan { get; set; }

        /// <summary>
        /// 联系人办公电话
        ///</summary>
        [Display(Name = "联系人姓名")]
        public string? LinkPhone { get; set; }

        /// <summary>
        /// 位置坐标数
        /// </summary>
        [Display(Name = "位置坐标数")]
        public int? PositionCount { get; set; }

        ///// <summary>
        ///// WGS84 纬度
        /////</summary>
        //[Display(Name = "纬度")]
        //[Required(ErrorMessage = "{0}不能为空")]
        //public decimal Lat { get; set; }

        ///// <summary>
        ///// WGS84 经度
        /////</summary>
        //[Display(Name = "经度")]
        //[Required(ErrorMessage = "{0}不能为空")]
        //public decimal Lng { get; set; }

        /// <summary>
        /// 项目地点
        ///</summary>
        [Display(Name = "项目地点")]
        public string? Address { get; set; }

        /// <summary>
        /// 立项文号
        ///</summary>
        [Display(Name = "项目地点")]
        public string? ApprovalNum { get; set; }

        /// <summary>
        /// 立项级别。参考立项级别字典表
        ///</summary>
        [Display(Name = "立项级别")]
        public 项目立项级别? ApprovalLevel { get; set; }

        /// <summary>
        /// 建设规模。参考建设规模字典表
        ///</summary>
        [Display(Name = "建设规模")]
        public 项目建设规模类型? SizeType { get; set; }

        /// <summary>
        /// 建设性质。参考建设性质分类字典表
        ///</summary>
        [Display(Name = "建设性质")]
        public 项目建设性质分类? PropertyNum { get; set; }

        /// <summary>
        /// 工程用途。参考工程用途字典表
        ///</summary>
        [Display(Name = "工程用途")]
        public 工程用途? FunctionNum { get; set; }

        /// <summary>
        /// 工程建设项目资金来源的种类，详见代码表
        ///</summary>
        [Display(Name = "项目资金来源")]
        public 项目资金来源? FundsSource { get; set; }

        /// <summary>
        /// 对应《工程建设项目审批管理系统》项目代码。（如果有）
        ///</summary>
        [Display(Name = "项目资金来源")]
        public string? GgProjectCode { get; set; }

        /// <summary>
        /// 指工程建设项目中标合同价格，单位为元（不需要招投标的项目使用工程造价代替）
        ///</summary>
        [Display(Name = "中标合同价格,单位为元")]
        public decimal? ContractAmount { get; set; }

        /// <summary>
        /// 指工程建设项目合同约定的项目开工日期
        ///</summary>
        [Display(Name = "合同开工日期")]
        public DateTime? ContractStartDate { get; set; }

        /// <summary>
        /// 指工程建设项目合同约定的项目竣工日期
        ///</summary>
        [Display(Name = "合同竣工日期")]
        public DateTime? ContractEndDate { get; set; }

        /// <summary>
        /// 是否树立维权告示牌
        /// 默认值: b'0'
        ///</summary>
        [Display(Name = "是否树立维权告示牌")]
        [Required(ErrorMessage = "{0}不能为空")]
        public bool HasSafeguardingBoard { get; set; }

        /// <summary>
        /// 是否有工程款支付担保
        /// 默认值: b'0'
        ///</summary>
        [Display(Name = "是否有工程款支付担保")]
        public bool? HasEarnestMoney { get; set; }

        /// <summary>
        /// 担保单位名称
        ///</summary>
        [Display(Name = "担保单位名称")]
        public string? EarnestUnitName { get; set; }

        /// <summary>
        /// 担保单位统一社会信用代码
        ///</summary>
        [Display(Name = "担保单位统一社会信用代码")]
        public string? EarnestUnitCode { get; set; }

        /// <summary>
        /// 担保金额
        ///</summary>
        [Display(Name = "担保金额")]
        public decimal? EarnestMoney { get; set; }

        /// <summary>
        /// 担保开始日期
        ///</summary>
        [Display(Name = "担保开始日期")]
        public DateTime? EarnestStartDate { get; set; }

        /// <summary>
        /// 担保终止日期
        ///</summary>
        [Display(Name = "担保终止日期")]
        public DateTime? EarnestEndDate { get; set; }

        /// <summary>
        /// 中标通知书附件列表
        /// </summary>
        [Display(Name = "中标通知书附件列表")]
        public List<string> Attachments { get; set; } = new List<string>();

        /// <summary>
        /// 担保文件附件列表
        /// </summary>
        [Display(Name = "担保文件附件列表")]
        public List<string> EarnestAttachments { get; set; } = new List<string>();

        /// <summary>
        /// 无监理证明附件
        /// </summary>
        [Display(Name = "无监理证明附件")]
        public List<string> NoSupervisorAttachments { get; set; } = new List<string>();

        /// <summary>
        /// 多地施工证明附件
        /// </summary>
        [Display(Name = "多地施工证明附件")]
        public List<string> PositionAttachments { get; set; } = new List<string>();

        /// <summary>
        /// 是否多地施工
        /// </summary>
        [Display(Name = "是否多地施工")]
        [Required(ErrorMessage = "{0}不能为空")]
        public bool IsMultiConstruction { get; set; }

        /// <summary>
        /// 监管单位Id
        /// </summary>
        [Display(Name = "监管单位Id")]
        [Required(ErrorMessage = "{0}不能为空")]
        public int DeptId { get; set; }

        /// <summary>
        /// 是否有监理企业
        /// </summary>
        [Display(Name = "是否有监理企业")]
        [Required(ErrorMessage = "{0}不能为空")]
        public bool HasSupervisor { get; set; }

        /// <summary>
        /// 无监理企业原因
        /// </summary>
        [Display(Name = "无监理企业原因")]
        public string? SupervisorContent { get; set; }

        /// <summary>
        /// 中标通知书编号
        /// </summary>
        [Display(Name = "中标通知书编号")]
        public string? LetterAcceptanceNum { get; set; }

        /// <summary>
        /// 招标标段编号
        /// </summary>
        [Display(Name = "招标标段编号")]
        public string? BiddingSectionNum { get; set; }

        /// <summary>
        /// 指挥部
        /// </summary>
        [Display(Name = "指挥部")]
        public int? CommanderId { get; set; }
    }
}